package com.gyf.immersionbar.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.gyf.barlibrary.ImmersionBar;
import com.gyf.immersionbar.R;


/**
 * @author geyifeng
 * @date 2017/7/19
 */
public class FragmentActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected int getLayoutId() {
        return R.layout.activity_fragment;
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this).titleBar(R.id.toolbar).init();
    }

    @Override
    protected void initView() {
        super.initView();
        findViewById(R.id.btn_one).setOnClickListener(this);
        findViewById(R.id.btn_two).setOnClickListener(this);
        findViewById(R.id.btn_three).setOnClickListener(this);
        findViewById(R.id.btn_four).setOnClickListener(this);
        findViewById(R.id.btn_five).setOnClickListener(this);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_one:
                startActivity(new Intent(this, FragmentOneActivity.class));
                break;
            case R.id.btn_two:
                startActivity(new Intent(this, FragmentTwoActivity.class));
                break;
            case R.id.btn_three:
                startActivity(new Intent(this, FragmentThreeActivity.class));
                break;
            case R.id.btn_four:
                startActivity(new Intent(this, FragmentFourActivity.class));
                break;
            case R.id.btn_five:
                startActivity(new Intent(this, FragmentFiveActivity.class));
                break;
            default:
                break;
        }
    }
}
